import 'package:ati_package/core/extension/ati_widgets_extension.dart';
import 'package:ati_package/core/utils/ati_assets.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:get/get_core/src/get_main.dart';

class AtiBaseDialog extends StatelessWidget {
  final Widget? child;
  const AtiBaseDialog({super.key, this.child});

  @override
  Widget build(BuildContext context) {
    return Dialog(
      backgroundColor: Colors.transparent,
      insetPadding: EdgeInsets.symmetric(horizontal: 30.r),
      shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(16.r)),
      child: Column(
        mainAxisSize: MainAxisSize.min,
        mainAxisAlignment: MainAxisAlignment.center,
        children: [
          child ?? SizedBox(),

          Container(
            margin: EdgeInsets.only(top: 25.r),
            child: Image.asset(
              width: 24.r,
              height: 24.r,
              AtiAssets.atiDeleteIcon,
              package: 'ati_package',
            ),
          ).addTapGesture(onTap: Get.back),
        ],
      ),
    );
  }
}
